﻿using System.Data;

namespace DAL
{
    public static class DalReligion
    {
        private static readonly clsConnect Cls = new clsConnect();
        #region[Get-Data]
        public static DataTable GetReligion(string keywords)
        {
            Cls.CreateNewSqlCommand();
            Cls.AddParameter("@KEYWORDS", keywords);
            return Cls.GetData("sp_Religion_Get");
        }
        public static DataTable GetReligionEdit(int id)
        {
            Cls.CreateNewSqlCommand();
            Cls.AddParameter("@Religion_ID", id);
            return Cls.GetData("sp_Religion_Get_Edit");
        }
        #endregion

        #region[Insert-Update-Delete]
        public static bool Insert(EtReligion obj)
        {
            Cls.CreateNewSqlCommand();
            Cls.AddParameter("@Religion_Alias", obj.Religion_Alias);
            Cls.AddParameter("@Religion_Name", obj.Religion_Name);
            Cls.AddParameter("@Religion_Note", obj.Religion_Note);
            return Cls.ExecuteNonQuery("sp_Religion_Insert");
        }
        public static bool Update(EtReligion obj)
        {
            Cls.CreateNewSqlCommand();
            Cls.AddParameter("@Religion_ID", obj.Religion_ID);
            Cls.AddParameter("@Religion_Alias", obj.Religion_Alias);
            Cls.AddParameter("@Religion_Name", obj.Religion_Name);
            Cls.AddParameter("@Religion_Note", obj.Religion_Note);
            return Cls.ExecuteNonQuery("sp_Religion_Update");
        }
        public static bool Delete(EtReligion obj)
        {
            Cls.CreateNewSqlCommand();
            Cls.AddParameter("@Religion_ID", obj.Religion_ID);
            return Cls.ExecuteNonQuery("sp_Religion_Delete");
        }
        #endregion
    }
    public class EtReligion
    {
        public int Religion_ID { get; set; }
        public string Religion_Alias { get; set; }
        public string Religion_Name { get; set; }
        public string Religion_Note { get; set; }
    }
}